<template>
	<!-- #ifdef APP-NVUE -->
	<cell>
		<!-- #endif -->
		<view class="mail-list-department" @click="goDepartmentInfo">
			<image v-if="isImg" class="img" :src="info.avatar" mode=""></image>
			<view class="title">
				{{ info.user_department }}
			</view>
			<slot>
				<view class="num">
					{{ info.num }}人
				</view>
			</slot>
		</view>
	<!-- #ifdef APP-NVUE -->
	</cell>
	<!-- #endif -->
</template>

<script>
	export default {
		name: 'MailListDepartment',
		props: {
			isImg: {
				trpe: Boolean,
				default: true
			},
			info: {
				type: Object,
				default: () => ({
					avatar: require('@/static/images/common/people.png'),
					user_department: '总经办',
					num: '3'
				})
			}
		},
		methods: {
			goDepartmentInfo() {
				this.$emit('goDepartmentInfo', this.info);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.mail-list-department {
		display: flex;
		align-items: center;
		
		height: 70px;
		border-bottom: 1px solid #EEEEEE;
		
		box-sizing: border-box;
		.img {
			width: 70rpx;
			height: 70rpx;
			border-radius: 50%;
			
			margin-right: 40rpx;
		}
		.title {
			flex: 1;
			
			font-size: 32rpx;
			text-align: left;
			
			color: $uni-text-color;
		}
		.num {
			font-size: 32rpx;
			
			color: #999999;
		}
	}
</style>
